/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package primerventana;

import java.awt.*;
/**
 *
 * @author yoni1
 */
public class PrimerVentana extends Frame {
boolean inAnApplet = true;
public static void main(String args[]) {
    PrimerVentana window = new PrimerVentana();
    window.inAnApplet = false;
    window.setTitle("Primer Ejemplo");
    window.pack();
    window.show();
}
public PrimerVentana() {
    Panel panelAlto = new Panel();
    panelAlto.add("West", new Label("Cartel", Label.CENTER));
    panelAlto.add("East", new TextArea("Area de texto", 5, 20));
    add("North", panelAlto);
    Panel panelBajo = new Panel();
    panelBajo.add(new TextField("Campo de Texto"));
    panelBajo.add(new Button("Botón"));
    add("South",panelBajo);
}
    @Override
public boolean handleEvent(Event ev) {
    if (ev.id == Event.WINDOW_DESTROY) {
        if (inAnApplet) {
        dispose();
    } else {
    System.exit(0);
}
}
return super.handleEvent(ev);
}
}
